package org.infinitest.intellij;

import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;

public class WhenOpeningModule
{
  private StartDetectingInfinitestToolWindow window;

  @Before
  public void setUp()
  {
    window = new StartDetectingInfinitestToolWindow(null, new ModuleStub("test"));
  }

  @Test
  public void shouldScheduleInfinitestStartIfModuleHasFacets()
  {
    window.facetInitialized();
    window.projectOpened();
    assertTrue(window.isScheduled());
    assertFalse(window.isStarted());
  }

  @Test
  public void shouldNotStartInfinitestIfFacetsHaveNotBeenInitialized()
  {
    window.projectOpened();
    assertFalse(window.isScheduled());
    assertFalse(window.isStarted());
  }
}
